package com.swak.objsize;

import org.openjdk.jol.info.ClassLayout;

/**
 * 打印对象布局
 * 
 * @author DELL
 */
public class ClassLayoutMain {

	public static void main(String[] args) {

		char[] chars = new char[] {};
		System.out.println(ClassLayout.parseInstance(chars).toPrintable());

		chars = new char[] { '1' };
		System.out.println(ClassLayout.parseInstance(chars).toPrintable());

		chars = new char[] { '1', '1' };
		System.out.println(ClassLayout.parseInstance(chars).toPrintable());

		chars = new char[] { '1', '1', '1' };
		System.out.println(ClassLayout.parseInstance(chars).toPrintable());

		NullObject nullObject = new NullObject();
		System.out.println(ClassLayout.parseInstance(nullObject).toPrintable());
	}
}
